<?php

namespace Beike\Seller\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;

class LanguageController extends Controller
{
    /**
     * @param string $lang
     * @return \Illuminate\Http\RedirectResponse
     */
    public function index(Request $request)
    {
        $lang = $request->get('lang');
        $user         = current_seller_user();
        $user->locale = $lang;
        $user->save();

        return Redirect::back();
    }
}
